﻿using FarmSmartSleep.Common.Domain.BeginTable;
using FarmSmartSleep.Common.Dtos;
using FarmSmartSleep.Common.Infrastructure;
using MediatR;

namespace FarmSmartSleep.Organ.API.Application.SleepInfoCommands.RecordCommands
{
    public class FemaleEarTypeHandler : IRequestHandler<FamaleEarTypeCommand, Result>
    {
        private readonly IBaseRepository<SleepInfor> SleepInforbaseRepository;

        public FemaleEarTypeHandler(IBaseRepository<SleepInfor> sleepInforbaseRepository)
        {
            SleepInforbaseRepository = sleepInforbaseRepository;
        }
        //女性耳号下拉框
        public async Task<Result> Handle(FamaleEarTypeCommand request, CancellationToken cancellationToken)
        {
            var result=new Result() { Code=(int)CodeEnum.search};
            var list=SleepInforbaseRepository.GetAll().Where(x=>x.Gender==2).ToList();
            result.Data = list;
            return result;
        }
    }
}
